Skip to content

Conversation

@az2924
Copy link
Collaborator

@az2924 az2924 commented Jan 29, 2026

686

Description of changes

  • Beforehand, email verification would show as succeeded incorrectly because backend never received change in domain
  • Fixed it so that the correct email verification status with change of domain is reflected

Checklist before review

  • I have done a thorough self-review of the PR
  • Copilot has reviewed my latest changes, and all comments have been fixed and/or closed.
  • If I have made database changes, I have made sure I followed all the db repo rules listed in the wiki here. (check if no db changes)
  • All tests have passed
  • I have successfully deployed this PR to staging
  • I have done manual QA in both dev (and staging if possible) and attached screenshots below.

Screenshots

Dev

This is not an issue in dev.

Staging

Screenshot 2026-01-29 at 12.41.35 AM.pdf

@github-actions
Copy link
Contributor

Available PR Commands

  • /ai - Triggers all AI review commands at once
  • /review - AI review of the PR changes
  • /describe - AI-powered description of the PR
  • /improve - AI-powered suggestions
  • /deploy - Deploy to staging

See: https://github.com/tahminator/codebloom/wiki/CI-Commands

@github-actions
Copy link
Contributor

Title

686: Display correct email verfication success


PR Type

Bug fix


Description

  • Prevent false success on email verification

  • Add failure notification for invalid callbacks

  • Detect verification attempts via query params

  • Ensure single notification with ref guard


Diagram Walkthrough

flowchart LR
  SP["Settings.page.tsx"] --> QP["Read query params (state)"]
  SP --> CB["Parse backend callback (success, message)"]
  QP -- missing/invalid --> NF["Show red failure notification"]
  CB -- valid --> NS["Show success/error from backend"]
  SP --> RG["Ref guard to avoid duplicate toasts"]
Loading

File Walkthrough

Relevant files
Bug fix
Settings.page.tsx
Robust email verification notifications handling                 

js/src/app/settings/Settings.page.tsx

  • Read search params to detect verification attempts.
  • Show red error when callback is invalid or missing.
  • Preserve backend message when valid; color by success.
  • Add ref to prevent duplicate notifications.
+21/-8   

@github-actions
Copy link
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Logic Edge Case

The detection of a verification attempt relies on the presence of the 'state' query param. Confirm that all providers/flows set 'state' consistently; otherwise legitimate attempts without 'state' will not show an error and may miss the AC.

const isVerificationAttempt = searchParams.has("state");
const hasValidCallback = typeof success === "boolean" && message;

if (!isVerificationAttempt && !hasValidCallback) return;
Notification Guard

The ref-based guard prevents duplicate notifications but also prevents updates if query params change without remount (e.g., navigating between different verification links on the same page). Validate this UX or reset the guard on param changes if needed.

const hasShownNotification = useRef(false);

useEffect(() => {
  if (hasShownNotification.current) return;

  const isVerificationAttempt = searchParams.has("state");
  const hasValidCallback = typeof success === "boolean" && message;

  if (!isVerificationAttempt && !hasValidCallback) return;

  notifications.show({
    message:
      hasValidCallback ? message : (
        "Email verification has failed. Please either try again or contact support."
      ),
    color: hasValidCallback && success ? "green" : "red",
  });

  hasShownNotification.current = true;
}, [message, success, searchParams]);
Dependency Sensitivity

Including 'searchParams' in the effect deps may cause re-renders on every URL change due to its object identity; consider using specific values (e.g., searchParams.get('state')) to avoid unnecessary triggers.

}, [message, success, searchParams]);

@az2924
Copy link
Collaborator Author

az2924 commented Jan 29, 2026

/deploy

@github-actions
Copy link
Contributor

The command to deploy to staging for the commit b78361f has been triggered. View action run

@github-actions
Copy link
Contributor

Staging deployment succeeded for commit b78361f

View run

@az2924
Copy link
Collaborator Author

az2924 commented Jan 29, 2026

/deploy

@github-actions
Copy link
Contributor

The command to deploy to staging for the commit be1dbca has been triggered. View action run

@github-actions
Copy link
Contributor

Staging deployment succeeded for commit be1dbca

View run

@az2924
Copy link
Collaborator Author

az2924 commented Jan 29, 2026

/deploy

@github-actions
Copy link
Contributor

The command to deploy to staging for the commit 0acf363 has been triggered. View action run

@github-actions
Copy link
Contributor

Staging deployment succeeded for commit 0acf363

View run

@az2924
Copy link
Collaborator Author

az2924 commented Jan 30, 2026

/deploy

@github-actions
Copy link
Contributor

The command to deploy to staging for the commit a82175a has been triggered. View action run

@github-actions
Copy link
Contributor

Staging deployment succeeded for commit a82175a

View run

686: Addressed Co-Pilot comments

686: Return error redirect when domain change
@az2924
Copy link
Collaborator Author

az2924 commented Feb 1, 2026

/deploy

@codecov
Copy link

codecov bot commented Feb 1, 2026

Codecov Report

❌ Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...tinanetwork/codebloom/api/auth/AuthController.java 40.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2026

The command to deploy to staging for the commit e975404 has been triggered. View action run

@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2026

Staging deployment succeeded for commit e975404

View run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants